﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using com.paypal.sdk.util;

public partial class paypal_APIError : System.Web.UI.Page
{
    // Methods
    private void InitializeComponent()
    {
        base.Load += new EventHandler(this.Page_Load);
    }

    protected override void OnInit(EventArgs e)
    {
        this.InitializeComponent();
        base.OnInit(e);
    }

    private void Page_Load(object sender, EventArgs e)
    {
        if (!base.IsPostBack && (this.Session["errorresult"] != null))
        {
            NVPCodec codec = new NVPCodec();
            codec = (NVPCodec)this.Session["errorresult"];
            string s = "<center>";
            s = ((s + "<font size=2 color=black face=Verdana><b>PayPal API Error</b></font>" + "<br>") + "<br>" + "<b>A PayPal API has returned an error!</b><br>") + "<br>" + "<table width=400 class=api>";
            for (int i = 0; i < codec.Keys.Count; i++)
            {
                s = ((s + "<tr><td class=field> " + codec.Keys[i].ToString() + ":</td>") + "<td>" + codec.GetValues(i)[0] + "</td>") + "</tr>" + "<tr>";
            }
            s = s + "</table>" + "</center>";
            base.Response.Write(s);
            this.Session.Remove("errorresult");
        }
    }

}